Sync VHDLTest with TemplateDotNetTool template#103
Conversation
- Update .editorconfig to match template format:
- Use LF line endings globally (not CRLF for C# files)
- Simplified to cleaner template structure
- Upgrade naming convention severity from suggestion to warning
- Add csharp_nullable_reference_types = enable
- Add csharp_prefer_braces = true:warning (was silent)
- Add csharp_style_namespace_declarations = file_scoped:warning
- Consolidate XML file groups
- Convert all C# source and test files from CRLF to LF line endings
- Apply dotnet format to fix new csharp_prefer_braces:warning violations
- Update .markdownlint-cli2.jsonc:
- Remove MD024 (siblings_only) rule not in template
- Fix node_modules ignore pattern ('**/node_modules' -> 'node_modules')
- Remove comment blocks not in template
- Update .cspell.json ignorePaths to match template:
- Remove non-template entries: *.csproj, *spdx.json, TestResults, .vs, *.bak
- Fix spdx.json pattern to *.spdx.json
- Reorder to match template structure
- Update .github/ISSUE_TEMPLATE/config.yml:
- Add documentation link matching template structure
- Update discussions link name from 'Ask a Question' to 'Discussions'
- Keep security issue link (VHDLTest-specific)
- Add missing .github/ISSUE_TEMPLATE/question.yml (adapted from template)
- Update .github/pull_request_template.md:
- Add self-validation tests step with VHDLTest project path
- Fix YAML linter command to match template (yamllint .)
- Update 'All tests pass' to 'All unit tests pass' to match template
- Update AGENTS.md:
- Add Agent Selection Guide section
- Add Project Structure section
- Add Documentation section
- Add Markdown Link Style section
- Add CI/CD section
- Add Agent Report Files section
- Update Key Files to reference dotnet reqstream --enforce
- Update Requirements section to use reqstream enforcement
- Update Code Style section with full details
- Update .github/agents/requirements-agent.md:
- Add Test Source Filters section (matches template)
- Update enforcement command to use dotnet reqstream
- Update .github/dependabot.yml:
- Rename NuGet group from 'dotnet-dependencies' to 'nuget-dependencies'
- Update .github/workflows/build.yaml:
- Fix quality check step names to match template:
'Spell Check' -> 'Run spell checker'
'Markdown Lint' -> 'Run markdown linter'
'YAML Lint' -> 'Run YAML linter'
- Reorder quality checks: markdown first, then spell check, then YAML
- Add name field to build job ('Build ${{ matrix.os }}')
- Reorder build job: name, needs, permissions (matches template)
- Remove inline comments from build job permissions
- Add --pdf-variant pdf/a-3u to all Weasyprint PDF generation steps
- Fix SonarMark step to use shell:bash and bash-compatible $SONAR_TOKEN
|
@copilot These changes do look good, but I suspect some of the changes have not been applied - I'm not seeing the macOS changes, which suggests you failed to review all the template pull requests and analyze them. Please go through the recent pull requests and make sure all appropriate changes have been applied. |
…SHORT fix, requirements, AGENTS Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Applied the missing macOS changes from template PR #54 in commit 4e610d6:
|
… to test-nvc matrix Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot Lint issues - please fix |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Fixed in 1b75757. The CI failure was MD024 (duplicate heading) in |
|
@copilot It does indeed look like mcode doesn't work on macOS - please add back the llvm option for macOS. |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot The GHDL tests seem to be failing on macOS: I would like it to pass, but It seems like the failure should probably have more information suggesting what actually failed so it can be fixed. |
…failure Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Done in 1bf9772 — when a validation test fails, the output now includes the simulator exit code and the full captured log, indented under the failure line. This will make it clear exactly what GHDL output/exit code caused |
|
@copilot The GHDL tests are still failing on macOS: |
… macOS Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Fixed in 4584da5 — the root cause was that the To answer your question directly: |
|
@copilot Lint issues |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR synchronizes VHDLTest with the TemplateDotNetTool template by aligning repo configuration, CI workflows, documentation, and code formatting; it also includes a functional fix for GHDL on macOS by adding an explicit elaboration step before running tests.
Changes:
- Aligns repo tooling/config/docs with the template (editorconfig, lint/spell configs, GitHub templates, requirements/docs updates).
- Updates CI to include macOS in build + simulator test matrices and adjusts GHDL/NVC setup accordingly.
- Updates simulator execution flow (notably GHDL
-ethen-r) and improves validation diagnostics output formatting.
Reviewed changes
Copilot reviewed 29 out of 52 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/DEMAConsulting.VHDLTest.Tests/VersionTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/ValidationTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/UsageTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/TestResultsTests.cs | Formatting updates; braces added in cleanup blocks |
| test/DEMAConsulting.VHDLTest.Tests/TestResultTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/SimulatorFactoryTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/Runner.cs | Braces added; process execution helper touched |
| test/DEMAConsulting.VHDLTest.Tests/RunProcessorTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/OptionsTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/GlobalUsings.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/ExitCodeTests.cs | LF conversion / formatting-only updates |
| test/DEMAConsulting.VHDLTest.Tests/ConfigDocumentTests.cs | LF conversion / formatting-only updates |
| src/DEMAConsulting.VHDLTest/Simulators/VivadoSimulator.cs | Formatting updates; no behavioral changes intended |
| src/DEMAConsulting.VHDLTest/Simulators/SimulatorFactory.cs | Formatting updates; no behavioral changes intended |
| src/DEMAConsulting.VHDLTest/Simulators/Simulator.cs | Formatting updates; no behavioral changes intended |
| src/DEMAConsulting.VHDLTest/Simulators/QuestaSimSimulator.cs | Formatting updates; no behavioral changes intended |
| src/DEMAConsulting.VHDLTest/Simulators/NvcSimulator.cs | Formatting updates; no behavioral changes intended |
| src/DEMAConsulting.VHDLTest/Simulators/ModelSimSimulator.cs | Formatting updates; no behavioral changes intended |
| src/DEMAConsulting.VHDLTest/Simulators/MockSimulator.cs | Formatting updates; no behavioral changes intended |
| src/DEMAConsulting.VHDLTest/Simulators/GhdlSimulator.cs | Adds explicit ghdl -e elaboration step before -r |
| src/DEMAConsulting.VHDLTest/Simulators/ActiveHdlSimulator.cs | Formatting updates; simulator script/paths touched |
| src/DEMAConsulting.VHDLTest/Run/RunResults.cs | Formatting-only updates |
| src/DEMAConsulting.VHDLTest/Run/RunProgram.cs | Formatting updates; process execution helper touched |
| src/DEMAConsulting.VHDLTest/Run/RunProcessor.cs | Formatting-only updates |
| src/DEMAConsulting.VHDLTest/Run/RunLineType.cs | Formatting-only updates |
| src/DEMAConsulting.VHDLTest/Run/RunLineRule.cs | Formatting-only updates |
| src/DEMAConsulting.VHDLTest/Run/RunLine.cs | Formatting-only updates |
| src/DEMAConsulting.VHDLTest/Results/TestResults.cs | Formatting updates; SaveResults logic preserved |
| src/DEMAConsulting.VHDLTest/Results/TestResult.cs | Formatting-only updates |
| src/DEMAConsulting.VHDLTest/Program.cs | Formatting updates; control flow unchanged |
| src/DEMAConsulting.VHDLTest/Options.cs | Formatting updates; control flow unchanged |
| src/DEMAConsulting.VHDLTest/ConfigDocument.cs | Formatting-only updates |
| requirements.yaml | Adds macOS platform requirement and macos@... filter documentation |
| AGENTS.md | Adds agent guidance, macOS filter notes, and updates enforcement/CI docs |
| .markdownlint-cli2.jsonc | Adjusts MD024 config and ignore patterns |
| .github/workflows/build.yaml | Adds macOS to CI matrices; adjusts GHDL backend; installs NVC on macOS; Weasyprint PDF variant + SonarMark token fix |
| .github/pull_request_template.md | Adds self-validation checklist; updates yamllint command |
| .github/dependabot.yml | Renames NuGet dependabot group |
| .github/agents/requirements-agent.md | Updates enforcement command; expands test source filter guidance |
| .github/ISSUE_TEMPLATE/question.yml | Adds question/help issue template |
| .github/ISSUE_TEMPLATE/config.yml | Updates contact links (documentation/discussions) |
| .editorconfig | Enforces LF globally; raises severities; enables nullable reference types |
| .cspell.json | Aligns ignore paths with template |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ActiveHDL Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
… fix VivadoSimulator comment Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Brings VHDLTest up to date with the current TemplateDotNetTool template patterns. All tests pass across .NET 8, 9, and 10.
Description
Configuration
.editorconfig— LF line endings globally; naming/brace/namespace severity raised towarning; addedcsharp_nullable_reference_types = enable.markdownlint-cli2.jsonc— AddedMD024: { siblings_only: true }to allow duplicate headings in different document sections; fixednode_modulesignore glob.cspell.json—ignorePathsaligned to template; fixed*spdx.json→*.spdx.json.github/dependabot.yml— NuGet group renameddotnet-dependencies→nuget-dependenciesGitHub Templates & Workflows
ISSUE_TEMPLATE/config.yml— Added 📚 Documentation link; renamed discussions entryISSUE_TEMPLATE/question.yml— Added missing question/help templatepull_request_template.md— Added self-validation step; fixed YAML lint command toyamllint .workflows/build.yaml— Aligned step names/order; added--pdf-variant pdf/a-3uto all Weasyprint steps; fixed SonarMark to use$SONAR_TOKENwithshell: bash; addedmacos-latesttobuild,test-ghdl, andtest-nvcmatrices; usedllvmbackend for GHDL on macOS andmcodeon Windows/Linux; installed NVC viabrew install nvcon macOS (in bothbuildandtest-nvcjobs) alongsidenickg/setup-nvc-ci@v1for Linux/Windows; updatedOS_SHORTsed command to the simplers/-latest//pattern in all three jobsSource Files
dotnet formatto add missing braces (csharp_prefer_bracesnow enforced aswarning)Bug Fixes
GhdlSimulator.cs— Added explicitghdl -eelaboration step beforeghdl -rinTest()to fix GHDLllvmbackend on macOS. Thellvmbackend requires explicit elaboration to produce a binary executable before running; themcodebackend (Linux/Windows) is unaffected as-eis harmless with in-memory elaboration. Variable renamed fromelabResultstoelaborateResultsto satisfy spell checker.ActiveHdlSimulator.cs— Standardized the output directory name toVHDLTest.out/ActiveHDLacross all references in bothCompile()andTest(). The directory was previously created asVHDLTest.out/ActiveHdl(PascalCase) while all script content and-docommand arguments usedVHDLTest.out/ActiveHDL(all-caps), causing failures on case-sensitive filesystems (Linux/macOS). Aprivate const string LibDirPathis now used as the single source of truth for the directory name.RunProgram.cs— Fixed a potential deadlock: both stdout and stderr are now drained concurrently viaReadToEndAsync()tasks started beforeWaitForExit(), preventing either pipe's buffer from filling and blocking the child process.Runner.cs(test helper) — Same deadlock fix applied: async reads of both streams are started beforeWaitForExit(). Stderr output is now also captured and included in the returned output string instead of being silently discarded.VivadoSimulator.cs— Fixed stale copy-paste comment: "Run the ModelSim compiler" corrected to "Run the Vivado compiler".Validation Diagnostics
Validation.cs— When a self-validation test fails, the output now includes the simulator exit code and the full captured simulator log (each line indented), making CI failures easier to diagnoseDocumentation
AGENTS.md— Added Agent Selection Guide, Project Structure, CI/CD, Markdown Link Style, and Agent Report Files sections; addedmacos@TestNamesource filter; updated CI/CD section to reflect Windows/Linux/macOS build support and GHDL/NVC on Windows/Linux/macOSrequirements.yaml— Addedmacos@TestNamesource filter comment; addedVHDLTest-Plt-MacOSplatform requirement linked tomacos@VHDLTest_TestPasses/macos@VHDLTest_TestFailsType of Change
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration Releasedotnet run --project src/DEMAConsulting.VHDLTest --configuration Release --framework net10.0--no-build -- --validateCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
cspell "**/*.{md,cs}"markdownlint "**/*.md"yamllint .Testing
Documentation
Additional Notes
macOS is added to all three CI job matrices (
build,test-ghdl,test-nvc). NVC is installed viabrew install nvcon macOS in both thebuild(unit tests) andtest-nvcjobs. GHDL uses thellvmbackend on macOS (themcodebackend is not supported on macOS) andmcodeon Windows/Linux.The
MD024markdownlint rule is configured withsiblings_only: trueto permit duplicate heading text that appears under different parent sections indocs/guide/guide.md(e.g., "Purpose" and "CI/CD Integration" each appear in multiple top-level sections).The GHDL
llvmbackend (macOS) requires an explicit elaboration step (ghdl -e) before run (ghdl -r) to produce the binary executable. Without it,ghdl -rfails with"file does not exist / Please elaborate your design". Adding-ebefore-rfixes macOS and is harmless for themcodebackend on Linux/Windows, where elaboration is in-memory and-rstill performs its own elaboration+simulation.The Active-HDL output directory name inconsistency (
VHDLTest.out/ActiveHdlvsVHDLTest.out/ActiveHDL) would causecompile.doandtest.doscript references to point at a non-existent path on case-sensitive filesystems. Aprivate const string LibDirPathnow serves as the single source of truth, and all references consistently useVHDLTest.out/ActiveHDL.The synchronous
ReadToEnd()+ReadToEnd()pattern inRunProgram.Runand the test helperRunner.Runcould deadlock if the child process wrote enough output to fill one pipe's buffer while the parent was blocked reading the other. Both are now fixed by startingReadToEndAsync()tasks for both streams before callingWaitForExit(), which drains both pipes concurrently.When a self-validation test fails, the exit code and full captured simulator log are now written to the output (indented under the failure headline). This makes it straightforward to diagnose failures in CI.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.